package za.org.jcicada.cfgmngr.impl;

import java.net.URI;
import java.util.Set;

import za.org.jcicada.cfgmngr.IConfigurationClient;
import za.org.jcicada.cfgmngr.SystemSetType;
import za.org.jcicada.genss.ServiceURN;
import za.org.jcicada.genss.SystemURN;
import za.org.jcicada.genss.messages.Result;
import za.org.jcicada.genss.sensor.SensorURN;

public class StubConfigurationClient implements IConfigurationClient {

    public boolean disconnected = false;
    public Result result;
    public URI locationURI;
    public SystemURN systemURN;
    public Object configuration;
    public ServiceURN serviceURN;
    public boolean reregister;
    public SystemSetType type;
    public Set<SystemURN> systemURNs;
    public Set<SensorURN> sensorURNs;
    public Set<ServiceURN> serviceURNs;
    
    public void informDisconnect() {
        disconnected = true;
    }

    public void replyDeregisterService(Result result, URI locationURI, ServiceURN serviceURN) {
        this.result = result;
        this.locationURI = locationURI;
        this.serviceURN = serviceURN;
    }

    public void replyDeregisterSystem(Result result, SystemURN systemURN) {
        this.result = result;
        this.systemURN = systemURN;
    }

    public void replyGetConfiguration(Result result, Object configuration) {
        this.result = result;
        this.configuration = configuration;
    }

    public void replyLocateService(Result result, ServiceURN serviceURN, URI locationURI) {
        this.result = result;
        this.serviceURN = serviceURN;
        this.locationURI = locationURI;
    }

    public void replyRegisterService(Result result, URI locationURI, ServiceURN serviceURN) {
        this.result = result;
        this.locationURI = locationURI;
        this.serviceURN = serviceURN;
    }

    public void replyRegisterSystem(Result result, SystemURN systemURN, boolean reregister) {
        this.result = result;
        this.systemURN = systemURN;
        this.reregister = reregister;
    }

	public void replySystemSet(Result result, SystemSetType type, Set<SystemURN> systemURNs) {
		this.result = result;
		this.type = type;
		this.systemURNs = systemURNs;
	}

	public void replySensorSet(Result result, SystemURN systemURN, Set<SensorURN> sensorURNs) {
		this.result = result;
		this.systemURN = systemURN;
		this.sensorURNs = sensorURNs;
	}
	
	public void replyServiceSet(Result result, SystemURN systemURN, Set<ServiceURN> serviceURNs) {
		this.result = result;
		this.systemURN = systemURN;
		this.serviceURNs = serviceURNs;
	}

}
